<?php

$auth = $_SESSION['auth'];
if (empty($auth)) die('用户未登录！');

if (empty($_POST)) die;

$content = cleanjs($_POST['content']);

if (empty($content)) die(json_encode(array('msg' => '空的内容！', 'token' => get_token())));

$rs = dt_query("INSERT INTO shuo (content, user_id, user_name, c_at) VALUES ('$content', '".$auth['id']."', '".$auth['name']."', ".time().")");
if (!$rs) die('发布说说失败！');

$rs = dt_query("UPDATE user_info SET shuo_c = shuo_c + 1 WHERE id = ".$auth['id']);
if (!$rs) die('统计说说数失败！');

die(json_encode(array('msg' => 's0', 'token' => get_token())));
